import messageApi from "@/api/declaration/messageApi"
import httpRequest from "@/config/axios/httpRequest"
import { 
  NotifySendReqModel, 
  NotifyTemplateModel 
} 
from "@/models/message/NotifyTemplateModel"


// 查询站内信模板列表
export const getNotifyTemplatePage = async (params: PageParam) => {
  return await httpRequest.get(messageApi.GetNotifyTemplatePage, { params })
}

// 查询站内信模板详情
export const getNotifyTemplate = async (id: number) => {
  return await httpRequest.get(messageApi.GetNotifyTemplate, { params: { id } })
}

// 新增站内信模板
export const createNotifyTemplate = async (data: NotifyTemplateModel) => {
  return await httpRequest.post(messageApi.CreateNotifyTemplate, data)
}

// 修改站内信模板
export const updateNotifyTemplate = async (data: NotifyTemplateModel) => {
  return await httpRequest.put(messageApi.UpdateNotifyTemplate, data)
}

// 删除站内信模板
export const deleteNotifyTemplate = async (id: number) => {
  return await httpRequest.delete(messageApi.DeleteNotifyTemplate, { params: { id } })
}

// 发送站内信
export const sendNotify = (data: NotifySendReqModel) => {
  return httpRequest.post(messageApi.SendNotify, data)
}
